﻿<local:DocumentBase x:Class="WPFExcelReport.VK02AV95"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                      
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    Loaded="Window_Loaded"
                    Title="Planning"  
                    HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch"
     >
    <local:DocumentBase.Resources>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource x:Key="vKPOSViewSource" Source="{Binding Path=VKPOS, Source={StaticResource iNTEXDataSet}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <StackPanel  Margin="0,0,0,0" Name="MainPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Expander Header="查询条件" Name="zoneQueryCond"  IsExpanded="True" ExpandDirection="Up"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Top">
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Button Grid.Row="0" Content="查询"  Height="23" HorizontalAlignment="Left" Margin="0,0,0,0" Name="btnQuery"
                            VerticalAlignment="Top" Width="75" Click="btnQuery_Click" />
                    <Button Content="生成报表"  Height="23" HorizontalAlignment="Left" Margin="94,0,0,0" Name="btnReport"
                            VerticalAlignment="Top" Width="75" />
                    <StackPanel Grid.Row="1" >                        
                        <Grid DataContext="{StaticResource vKPOSViewSource}" 
                               HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="客户:"  Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                            <ComboBox DisplayMemberPath="VKPKUNDNR"
                                  Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left"
                                  ItemsSource="{Binding VKPKUNDNR}" Margin="3" 
                                  Name="vKPKUNDNRComboBox" VerticalAlignment="Center" Width="120">
                                <ComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </ComboBox.ItemsPanel>
                            </ComboBox> 
                        </Grid>
                    </StackPanel>
                </Grid>
            </Expander>
            <Expander Header="数据" Name="zoneDataList"  IsExpanded="True"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="60" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="20"/>
                    </Grid.RowDefinitions>
                    <StackPanel Height="60" VerticalAlignment="Top">
                        <StatusBar Name="stBarPrimary" Background="AntiqueWhite" Margin="0,9.056,0,0">
                            <StatusBarItem>
                                <TextBlock Name="tbStatus">查询进展:</TextBlock>
                            </StatusBarItem>
                            <StatusBarItem>
                                <ProgressBar Height="12" Width="400" Margin="20,0,5,1" Name="pBar1" Visibility="Hidden" VerticalAlignment="Bottom" />
                            </StatusBarItem> 
                        </StatusBar>
                    </StackPanel>
                    <StackPanel Grid.Row="1"> 
                            <fd:FilteringDataGrid AutoGenerateColumns="False" EnableRowVirtualization="True"  
                                              ItemsSource="{Binding Source={StaticResource vKPOSViewSource}}" 
                                              x:Name="vKPOSDataGrid" 
                                                CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="1000"
                                              Height="400"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              >
                            <DataGrid.Columns>
                                <DataGridTextColumn x:Name="vKPAUFKRSColumn" Binding="{Binding Path=VKPAUFKRS}" Header="前缀" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPAUFLFDColumn" Binding="{Binding Path=VKPAUFLFD}" Header="单号" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPAUFPOSColumn" Binding="{Binding Path=VKPAUFPOS}" Header="行" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPNEUBENColumn" Binding="{Binding Path=VKPNEUBEN}" Header="负责人" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPNEUDATColumn" Binding="{Binding Path=VKPNEUDAT}" Header="录单日期" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPKUNDNRColumn" Binding="{Binding Path=VKPKUNDNR}" Header="客户" Width="SizeToCells"/>
                                <DataGridTextColumn x:Name="vKPPOSTYPColumn" Binding="{Binding Path=VKPPOSTYP}" Header="单类" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPARTColumn" Binding="{Binding Path=VKPART}" Header="品种" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPFARBEColumn" Binding="{Binding Path=VKPFARBE}" Header="色号" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPWUTERMColumn" Binding="{Binding Path=VKPWUTERM}" Header="交期" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPMEEHColumn" Binding="{Binding Path=VKPMEEH}" Header="单位" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPMENGE1Column" Binding="{Binding Path=VKPMENGE1}" Header="数量" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPRESERVColumn" Binding="{Binding Path=VKPRESERV}" Header="计划" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPZUGETColumn" Binding="{Binding Path=VKPZUGET}" Header="留位" Width="SizeToCells" />
                                <DataGridTextColumn x:Name="vKPERLColumn" Binding="{Binding Path=VKPERL}" Header="状态" Width="SizeToCells" />
                            </DataGrid.Columns>
                        </fd:FilteringDataGrid> 
        </StackPanel>
                </Grid>
            </Expander>
        </StackPanel>
    </Grid>
</local:DocumentBase>
